home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-04 / tool_inc.zip / COPYTIME.INC < prev    next >
Text File  |  1989-06-02  |  740b  |  33 lines

  1.  
  2.  
  3. (*
  4.  * COPYTIME.INC - This utility library will copy the timestamp
  5.  *                of one file to another file.
  6.  *
  7.  * The statement
  8.  *   {$I \shs\tools\dosio.inc}
  9.  * is required in the main program
  10.  *
  11.  * Author: S.H.Smith, 4/4/86
  12.  *
  13.  *)
  14.  
  15. procedure copytime(fromname: anystring; toname: anystring);
  16. var
  17.    fd:     integer;
  18.    time:   integer;
  19.    date:   integer;
  20.  
  21. begin
  22.    fd := dos_open(fromname, open_read);
  23.    dos_file_times(fd,time_get,time,date);
  24.    if dos_close(fd) = dos_error then
  25.       writeln(con,'copytime: close error');
  26.  
  27.    fd := dos_open(toname, open_update);
  28.    dos_file_times(fd,time_set,time,date);
  29.    if dos_close(fd) = dos_error then
  30.       writeln(con,'copytime: to close error');
  31. end;
  32.  
  33.